package com.nt;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class Server implements Runnable{
	static ServerSocket server;
	static Socket socket;


	public static void main(String [] args) throws IOException{
		server = new ServerSocket(3000);
		final Socket s = server.accept();
		Thread th = new Thread(new Runnable(){

			@Override
			public void run() {
				// TODO Auto-generated method stub
				try {
					BufferedReader  read = new BufferedReader(new InputStreamReader(socket.getInputStream()));
					PrintWriter  writer = new PrintWriter(s.getOutputStream());
					String text;
					while((text = read.readLine()) != null){
						writer.print(text);
						writer.flush();
					}
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			

		});
	}


	@Override
	public void run() {
		// TODO Auto-generated method stub
		
	}
}
